pp108 : Creating a Custom Class

Creating a Custom Class

This topic describes the process of creating a custom class.

A custom class can be either a pure custom class, a derived custom class, or an inherited custom class. Each type of class is created in a different way, using different options that are available. However, the procedure for creating a custom class is common for all the three types.

  1. Double-click (<WS-AppServer Package>) from either of the following locations:
    • Workspace Documents (My Recent Documents) window.
    • Workspace Documents (Explorer)> <solution> > <project>. The WS-AppServer Package window appears, displaying the data models and their corresponding attributes, methods, and relations.
  2. On the WS-AppServer Package toolbar, click . The Create Class from Object Layout dialog box appears.
  3. On the Layout Tree tab, in the Class/Attribute Information box, provide a name for the class and fill other details.
  4. In the Class Layout box, right-click the <root class> and do the following:
    • To add a class within, select Add > Class, and provide a name for it when prompted. Subsequently, in the Class/Attribute Information box, provide other details to define the class.
    • To add an attribute within, select Add > Attribute, and provide a name for it when prompted. Subsequently, in the Class/Attribute Information box, provide other details to define the attribute. The object layout is formed in the tree structure.

      Note: Depending upon your business logic requirements, you can add as many number of classes and attributes to the root class.

      Tip: You can view the object layout in XML on the Layout XML tab. You can also modify the XML structure there and see the changes reflecting in the tree layout.

  5. Click Create.
    The custom class is created under the Models group box, bearing the icon next to it.

    After you complete this task:
    Select the custom class that you created and generate Java code and Web service operations for it.
    If you need to modify the Custom class, right-click the class in Models group box and select Edit Object Layout. The Object Layout Editor appears, displaying the XML structure on the Layout XML tab.
    If you need to delete a Custom class, right-click the class in Models group box and select Delete.

Related concepts

Derived Custom Class

Related tasks

Creating a Query-based Custom Class
Viewing the Object Layout of a Class
Viewing and Editing the XML Structure of a WS-AppServer Model

Related reference

Object Layout of Custom Classes